Val (str)

Basic and Crystal syntax.

Arguments
Returns

Fractional Number

Action

The Val (str) function reads a string containing Numbers (example: an address, phone number, or social security number) and converts them to a decimal value. Val stops reading the string when it finds the first character in the string that it finds that it can not recognize as a number or as a space.

Typical uses

Use this function to extract only the numeric portion of a string that contains both numbers and text. For instance, you can extract only the street number from an address, or only the numeric portion of an ID that contains letters and numbers.

Examples

The following example is applicable to both Basic and Crystal syntax:

Val("2234 100th Street")

Returns 2234100.

Comments

This function is designed to work like the Visual Basic function of the same name.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com